import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Other from '@/components/Other'
import About from '@/components/About/About'
import Software from '@/components/Software/Software'
import Science from '@/components/Science/Science'
import TeamStatus from '@/components/TeamStatus/TeamStatus'
import Awards from '@/components/Awards/Awards'
import Community from '@/components/Community/Community'
import Detail from "@/components/Awards/components/Detail"

Vue.use(Router)

// -------------------------------------------------防止路由重复报错
//获取原型对象上的push函数
const originalPush = Router.prototype.push
//修改原型对象中的push方法
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [
    { path: '/', redirect: '/Home' },
    { path: '/Home', component: Home },
    {
      path: '/Other',
      component: Other,
      children: [
        { path: '/About', component: About },
        { path: '/Software', component: Software },
        { path: '/Science', component: Science },
        { path: '/TeamStatus', component: TeamStatus },
        {
          path: '/Awards', component: Awards
        },
        { path: '/Community', component: Community },
      ]
    }
  ]
})
